<form id="subject-result-update-form">
    <h3>修改课题研究人员信息</h3>
    <input type="hidden" name="subject_id" value="$!subjectId">
    <input type="hidden" name="id" value="$!result.id">
    <table>
        <tr>
            <td>负责人：</td>
            <td><input type="text" autocomplete="off" name="principal" value="$!result.principal"></td>
        </tr>
        <tr>
            <td>完成时间：</td>
            <td><input type="date" name="completetime" value="$!dateTool.format('yyyy-MM-dd',$result.completetime)"></td>
        </tr>
        <tr>
            <td>最终成果名称：</td>
            <td><input type="text" autocomplete="off" name="finalresult_name" value="$!result.finalresultName"></td>
        </tr>
        <tr>
            <td>最终成果形式：</td>
            <td><input type="text" autocomplete="off" name="finalresult_shape" value="$!result.finalresultShape"></td>
        </tr>
    </table>
</form>
<input type="button" value="提交" onclick="subjectResultUpdate()">
<input type="button" value="返回" onclick="history.go(-1);">
<script type="text/javascript">
    function subjectResultUpdate() {
        $.ajax({
            url: "/api/subject/result/update",
            type: "post",
            data: $("#subject-result-update-form").serialize(),
            dataType: "json",
            cache: false, // 上传文件无需缓存
            beforeSend: function() {
            },
            complete: function() {
            },
            success: function (result) {
                alert(result.msg);
                if (result.code == 200) {
                    openUrl("/subject/$!subjectId/edit/result");
                }
            },error: function (result) {
                alert("网络连接出错！");
            }
        });
    }
</script>
